package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.enums.ParticularsIdentityRightsEnum;
import com.sc.nft.mapper.ParticularsIdentityRightsMapper;
import com.sc.nft.entity.ParticularsIdentityRights;
import com.sc.nft.service.ParticularsIdentityRightsService;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

/**
 * (ParticularsIdentityRights)表Dao层
 *
 * @author 王伟成
 * @since 2024-03-09 15:03:35
 */
@Slf4j
@Repository
public class ParticularsIdentityRightsDao extends ServiceImpl<ParticularsIdentityRightsMapper, ParticularsIdentityRights> {

    public ParticularsIdentityRights getType(ParticularsIdentityRightsEnum type) {
        LambdaQueryWrapper<ParticularsIdentityRights> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(ParticularsIdentityRights::getType, type);
        return this.getOne(wrapper);
    }
}
